package com.yhsx.demo.server.starter;

import com.yhsx.demo.server.manager.ManagerServer;
import com.yhsx.demo.server.user.UserServer;
import jakarta.annotation.Resource;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;
import java.util.Map;

/**
 * @author slf
 * @apiNote
 * @since 2023/12/5
 */
@RestController
@SpringBootApplication(scanBasePackages = "com.yhsx.*")
public class App {
    public static void main(String[] args) {
        SpringApplication.run(App.class, args);
    }

    @Resource
    UserServer userServer;
    @Resource
    ManagerServer managerServer;

    @GetMapping("/")
    public Map<String, Object> get() {
        Map<String, Object> result = new HashMap<>();
        result.put("manager", managerServer.getManager());
        result.put("user", userServer.getUser());
        return result;
    }
}

